#ifndef HASH_H_INCLUDED
#define HASH_H_INCLUDED

#include "HashEntry.h"
#include <vector>
#include <list>
#include <string>
using namespace std;


class DetectHash{

public:
	explicit DetectHash(int size = 7) :tablesize(size), currsize(0), m_hashtable(size){


	}
	/*ok*/
	void insert(int x);

	/*ok*/
	bool remove(int x);

	void desc();


private:

	int tablesize;
	int currsize;
	
	vector<HashEntry> m_hashtable;


	int findpos(int x);

	/*ok*/
	inline int myhash(int x)
	{
		return x % tablesize;
	}

	void rehash();

	string state2str(int t)
	{
		switch (t)
		{
		case HashEntry::ACTIVE:
			return "ACTIVE";
		case HashEntry::DELETED:
			return "DELETED";
		case HashEntry::EMPTY:
			return "EMPTY";


		default:
			break;
		}
	}

};


#endif